package peace.gui.controls
{
import flash.events.Event;

// [Event(name="open", type="peace.gui.controls.ExistenceEvent")]
/**
 * Событие изменения статуса существования или видимости объекта
 */
public class ExistenceEvent extends Event
{
	public static const CREATE:String = "create";
	public static const DELETE:String = "delete";

	public static const OPEN:String = "open";
	public static const CLOSE:String = "close";
	
	public static const SHOW:String = "show";
	public static const HIDE:String = "hide";
	
	/**
	 * поле данных по целевому объекту 
	 */	
	public var data:*;


	public function ExistenceEvent(type:String, data:* = null, bubbles:Boolean=false, cancelable:Boolean=false)
	{
		super(type, bubbles, cancelable);
		this.data = data || target;
	}
	
	override public function clone():Event
	{
		return new ExistenceEvent(type, data, bubbles, cancelable);
	}
	
}
}